package bTree.LeetCode;

public class 判断子序列 {
    public boolean isSubsequence(String s, String t) {
        int lens = s.length(), lent = t.length();
        if (lens > lent) {
            return false;
        }
        if (lens == 0) {
            return true;
        }
        int left = 0;
        for (int i = 0; i < lent; i++) {
            if (t.charAt(i) == s.charAt(left)) {
                left++;
            }
            if (left == lens) {
                return true;
            }
        }

        return false;
    }
}